using System;
using System.Windows.Media.Media3D;
using Prism.Events;

namespace CPlatePrintSys.Annotation.Events
{
    /// <summary>
    /// 相机同步操作类型
    /// </summary>
    public enum CameraSyncOperation
    {
        /// <summary>
        /// 相机位置同步
        /// </summary>
        Position,
        
        /// <summary>
        /// 相机缩放同步
        /// </summary>
        Zoom,
        
        /// <summary>
        /// 相机旋转同步
        /// </summary>
        Rotation,
        
        /// <summary>
        /// 相机方向同步
        /// </summary>
        Direction,
        
        /// <summary>
        /// 完整相机状态同步
        /// </summary>
        Full
    }

    /// <summary>
    /// 相机同步事件参数
    /// </summary>
    public class CameraSyncEventArgs
    {
        /// <summary>
        /// 源控件ID
        /// </summary>
        public string SourceControlId { get; set; }

        /// <summary>
        /// 目标控件ID
        /// </summary>
        public string TargetControlId { get; set; }

        /// <summary>
        /// 同步操作类型
        /// </summary>
        public CameraSyncOperation Operation { get; set; }

        /// <summary>
        /// 相机位置
        /// </summary>
        public Point3D? Position { get; set; }

        /// <summary>
        /// 相机观察方向
        /// </summary>
        public Vector3D? LookDirection { get; set; }

        /// <summary>
        /// 相机向上方向
        /// </summary>
        public Vector3D? UpDirection { get; set; }

        /// <summary>
        /// 透视相机视野角度
        /// </summary>
        public double? FieldOfView { get; set; }

        /// <summary>
        /// 正交相机宽度
        /// </summary>
        public double? Width { get; set; }

        /// <summary>
        /// 时间戳（用于防重复处理）
        /// </summary>
        public long Timestamp { get; set; }

        /// <summary>
        /// 是否为初始同步（用于区分初始加载和用户操作）
        /// </summary>
        public bool IsInitialSync { get; set; }

        public CameraSyncEventArgs()
        {
            Timestamp = DateTime.Now.Ticks / 10000; // 毫秒级时间戳
            IsInitialSync = false;
        }
    }

    /// <summary>
    /// 相机同步事件
    /// </summary>
    public class CameraSyncEvent : PubSubEvent<CameraSyncEventArgs>
    {
    }
}
